<?php $this->load->view('admin/_header2') ?>

<table id="tt" class="easyui-datagrid" style="width:1100px;height:auto;">
	<thead>
	<tr height=32 >
		<th field="name0" align=center  width=30 ></th>
		<th field="Airline" align=center  width=50 >Airline</th>
		<th field="name2" align=center  width=100 >From Port</th>
		<th field="name3" align=center  width=100 >DestPort</th>
		<th field="name6" align=center  width=80>Ticket Time</th>
		<th field="name7" align=center  width=80 >Flight date</th>
		<th field="name11" align=center  width=80>Tax</th>
		<th field="name12" align=center  width=120>Oper</th>
	</tr>
	</thead>
	<tbody>
	<?php
	
	$index=0;
	foreach($result as $item)
	{
		$index++;
	?><tr align=center >
		<td><?=$index ?></td>
		<td><?=$item->airline  ?></td>
		<td><?=$item->Fromport?></td>
		<td><?=$item->Destport?></td>
		<td><?=Date("Y-m-d",strtotime($item->Effectdate1))."<br/>".Date("Y-m-d",strtotime($item->Effectdate2));  ?></td>
		<td><?=Date("Y-m-d",strtotime($item->Flightdate1))."<br/>".Date("Y-m-d",strtotime($item->Flightdate2)); ?></td>	
		<td><?=$item->Tax ?></td>
		<td><a href="#" class="orangeb" onclick="return editTax('<?=$item->PolicyGroup?>');" >edit</a>
			|<a href="#" class="orangeb" onclick="return delTax('<?=$item->id?>');" >delete</a>	
		</td>
	</tr>
	<?php
	}
	?></tbody>
</table>
<div id="pp" style="background:#efefef;border:1px solid #ccc;"></div>

<?
echo form_open("",array("id"=>"formquery"));
echo form_hidden($_POST);
echo form_close();

?>
<script language="javascript">
function editTax(sPolicGroup)
{
	window.parent.editTax(sPolicGroup);
	return false;
}
$(function(){
	$('#pp').pagination({
		total:<?=$iTotalCount?>,pageNumber:<?=$_POST['pagenumber']?>,pageSize:<?=$_POST['pagesize']?>,pageList:[2,5,10,20,30,50],
		onSelectPage:function(pageNumber, pageSize){
			$(this).pagination('loading');
			//alert('pageNumber:'+pageNumber+',pageSize:'+pageSize);
			$("input[name=pagesize]").val(pageSize);
			$("input[name=pagenumber]").val(pageNumber);
			$("#formquery").submit();
			$(this).pagination('loaded');
		}
	});
});

function delTax(sid)
{
	if(confirm("confirm to Delete this Tax?"))
	{
		window.location="deleteTax?id="+sid;	
	}
	
	return false;
}
</script>
<?php $this->load->view('admin/_footer1') ?>